<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>考试管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
//		AlisaYe
//		function get(){
//			var value='';
//			var radio = document.getElementsByName("ifCheckAnswer");
//			for(var i = 0;i<radio.length;i++)
//			{
//				if(radio[i].checked==true)
//				{value = radio[i].value;
//					break;}
//			}
//			alert(value);
//		}

		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({

				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});

			//			AlisaYe单选框事件
			$("#btnSubmit").click(function(){
				var value='';
				var radio = document.getElementsByName("ifCheckAnswer");
				for(var i = 0;i<radio.length;i++)
				{
					if(radio[i].checked==true)
					{value = radio[i].value;
						break;}
				}
			});

		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/teach/teachExam/">考试管理列表</a></li>
		<li class="active"><a href="${ctx}/teach/teachExam/form?id=${teachExam.id}">考试管理<shiro:hasPermission name="teach:teachExam:edit">${not empty teachExam.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="teach:teachExam:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="teachExam" action="${ctx}/teach/teachExam/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">考试科目名称：</label>
			<div class="controls">
				<form:input path="examName" htmlEscape="false" maxlength="64" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">考试开始时间：</label>
			<div class="controls">
				<input name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${teachExam.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">考试结束时间：</label>
			<div class="controls">
				<input name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${teachExam.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
				<span class="help-inline"><font color="red">*</font>开始时间早于结束时间 </span>
			</div>
		</div>
		<%--<div class="control-group">--%>
			<%--<label class="control-label">考试状态：</label>--%>
			<%--<div class="controls">--%>
				<%--<form:select path="examStatus" class="input-xlarge required">--%>
					<%--<form:option value="" label=""/>--%>
					<%--<form:options items="${fns:getDictList('exam_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
				<%--</form:select>--%>
				<%--<span class="help-inline"><font color="red">*</font> </span>--%>
			<%--</div>--%>
		<%--</div>--%>
		<div class="control-group">
			<label class="control-label">答题时间：</label>
			<div class="controls">
				<form:input path="answerTime" htmlEscape="false" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">可参加考试次数：</label>
			<div class="controls">
				<form:input path="examFrequency" htmlEscape="false" maxlength="64" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">是否可以查看答题情况：</label>
			<div class="controls">
				<input path="ifCheckAnswer" type="radio" name="ifCheckAnswer" value="1" />是&nbsp&nbsp&nbsp
				<input path="ifCheckAnswer" type="radio" name="ifCheckAnswer" value="0"  />否
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">下发试卷：</label>
			<div class="controls">
					<%--需求：显示所有下发？？--%>
				<select id="allPaper" name="allPaper" class="input-xlarge">
					<option value="0">无</option>
					<c:forEach items="${allPaperList}" var="allPaper">
						<option value="${allPaper.id}">${allPaper.paperName}</option>
					</c:forEach>
				</select>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="teach:teachExam:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>